// 国际化
import { createI18n } from "vue-i18n";
import en from "./en";
import zh from "./zh";
const messages = {
    en: {
        ...en
    },
    zh: {
        ...zh
    }
}
const getLocale = () => {
    const mylocale=localStorage.getItem('language')
    if(mylocale){//存在直接返回
        return mylocale
    }
    // 获取当前语言
    const nowLanguage=navigator.language.includes('zh')?'zh':'en'
    localStorage.setItem('language',nowLanguage)
    return nowLanguage

}
export const i18n = createI18n({
    locale: getLocale(),
    messages
}) 
